﻿using System;
using System.Collections.Generic;
using System.Text;

namespace _013_014_015_016_表达式_语句详解_15_2_
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //try
            Calculator calculator = new Calculator();
            int r = calculator.Add("null", "200");
            Console.WriteLine(r);
        }
    }

    public class Calculator
    {
        public int Add(string arg1, string arg2)
        {
            int a = 0;
            int b = 0;

            try
            {
                 a = int.Parse(arg1);
               
               
            }
            catch 
            {
                Console.WriteLine("arg1中元素错误");
                throw;
            }
            try
            {
                b = int.Parse(arg2);
            }
            catch
            {

                Console.WriteLine("arg2中元素错误");
                throw;
            }
            finally { 
            
            
            }
            int result = a + b;
            return result;
        }
    }
}
